package com.gitee.chili.leisure.listener;

import com.gitee.chili.leisure.server.ServerManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 监听 {@code Netty} 服务器的启动，使用 {@code spring boot} 提供的 {@link CommandLineRunner} 的方式
 *
 * @author zebulon
 * @since 2020/6/30
 */

@Component
public class NettyServerStartListener implements CommandLineRunner {

    @Autowired
    private ServerManager server;

    @Override
    public void run(String... args) throws Exception {
        server.start();
    }
}
